package gui;

import java.io.File;

import javax.swing.filechooser.FileFilter;

public class InputArchiveFilter extends FileFilter {

	private String end;
	public InputArchiveFilter() {
		this.end = ".rle2d";
	}
	public InputArchiveFilter(String end) {
		this.end = end;
	}

	@Override
	public boolean accept(File f) {
		if (f.isDirectory()) return true;
		if (f.getName() != null && f.getName().endsWith(end)){
			return true;
		}
		return false;
	}

	@Override
	public String getDescription() {
		return "Select file "+end;
	}

}
